package com.ymttest.database.sqlwapper.sqdistributor;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.sqdistributor.DistributionConfig;

public class DistributionConfigWrapper {
	
	SqlManager manager;

	public DistributionConfigWrapper() {
		manager = new SqlManager("sqdistributor");
	}

	@SuppressWarnings("unchecked")
	public DistributionConfig selectByPrimaryKey(Long id) {

		DistributionConfig distributionConfig = null;
		List<DistributionConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqdistributor.DistributionConfigMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() > 0) {
			distributionConfig = result.get(0);
		}

		return distributionConfig;
	}
	
	@SuppressWarnings("unchecked")
	public DistributionConfig selectByMerchantId(Long merchantId) {

		DistributionConfig distributionConfig = null;
		List<DistributionConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqdistributor.DistributionConfigMapper.selectByMerchantId",
						merchantId);
		manager.commit();

		if (result.size() > 0) {
			distributionConfig = result.get(0);
		}

		return distributionConfig;
	}
	
	public static void main(String[] args) {
		
		DistributionConfigWrapper test = new DistributionConfigWrapper();
		
//		SellerLevelHistory sellerLevelHistory = new SellerLevelHistory();
//		
//		sellerLevelHistory.setDDate(YMTDateUtil.getDate());
//		sellerLevelHistory.setSellerID(24635724);
//		sellerLevelHistory.setUpdateTime(YMTDateUtil.getDate());
//		sellerLevelHistory.setUnconfirm_amount(BigDecimal.TEN);
//		
		System.out.println(test.selectByPrimaryKey(4L));
	}
}
